'''
python base64.py decode YWJj
python base64.py encode abc
'''



import base64
import sys

if __name__ == '__main__':
    args = sys.argv
    if args[1] == 'encode':
        # default by utf-8
        print(base64.b64encode(args[2].encode()).decode())
    elif args[1] == 'decode':
        print(base64.b64decode(args[2].encode()).decode())
